#ifndef INSERTDATAWIDGET_H
#define INSERTDATAWIDGET_H

#include <QtSql>
#include <QVector>

#include "ui_insertdatawidget.h"

class QString;
class InsertDataWidget : public QWidget, public Ui::InsertDataWidget
{
Q_OBJECT

public:
	InsertDataWidget( QString table, QWidget * parent = 0);
	bool modified;
	
public slots:
	void revert();
	void submit();
	void refresh();
	void connectModel();
	
private slots:
	void addRow();
	void delRow();
	void beforeDelete();
	
private:
	QVector<int> hiddenRows;
	QSqlTableModel *model;
	QString table;
	void beforeInsert(QSqlRecord &record);
};
#endif
